package com.ld.security.auth.client.base.api;

import com.ld.security.auth.common.base.service.impl.InitAppServie;
import com.ld.security.common.core.base.vo.DataVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Api(tags = "系统内部")
public class SystemApi {


    @Autowired
    private List<InitAppServie> initAppServieList;


    @RequestMapping(value = "/initSystem",method = RequestMethod.POST)
    @ApiOperation("系统初始化")
    public DataVo initSystem(){
        for (InitAppServie initAppServie : initAppServieList) {
            initAppServie.initSystem();
        }
        DataVo  vo =  DataVo.of();
        vo.setMessage("初始化成功");
        return vo;
    }

}
